********************************************************************************
/*Analysis.do: multilevel logistic regression models with populist voting as dependent variable

In this do file the results of the main and supplementary analyses showed in the paper are reported

10/07/2024 
*/

clear all 
macro drop _all

* After downloading all the content of the data package folder, specify here the folder where data are. 
cd "C:\Users\franc\Desktop\POSTDOC_MILANO_STATALE\PROJECTS\ONGOING\CANOVAN_RESEARCH_NOTE\IPSR_DATAVERSE"  // specify the path

capture log close 
log using "Analysis", replace text

*Loading the dataset with all the prepared variables
use analysis_dataset.dta, clear
set scheme s1mono     

* Summary of the sample
tab S025

*****************--------------Bivariate relationships--------******************
* + Pluralism (lfirstp) (H.1)
melogit populist lfirstp  [pw=S017] || S025:  , or
margins, at(lfirstp=(-1.65 -1 -0.5 0 0.5 1 1.5 2 2.50)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(lijphart, replace)

* + Political globalisation (H.2a) 
melogit populist KOFPoGI [pw=S017] || S025:  , or
margins, at(KOFPoGI=(75 80 85 90 98)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(pol_glob, replace)

* + Economic globalisation (H.2b) 
melogit populist KOFEcGI [pw=S017] || S025:  , or
margins, at(KOFEcGI=(55 60 65 70 75 80 85 91)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(eco_glob, replace)

* + Checks on government (H.4) 
melogit populist b_checks [pw=S017] || S025:  , or
margins, at(b_checks=(55 60 65 70 75 80 85 91)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(checks, replace)

* Figure 1 - The association between the Lijphart's executive-parties dimension, political and economic globalization, and checks on government with the probability of supporting a populist party, with 95% confidence intervals
graph combine lijphart pol_glob eco_glob checks, col(2) ycommon scheme(s1mono) commonscheme iscale(.5) // (Figure 1)

*****************----Multilevel Logistic Regression Models----******************
* Dependent variable : Populist Parties
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] || S025: , or
estat icc
est store m0
* ICC: 27,45%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc i.S020 i.S003  [pw=S017] || S025:  , or
estat icc
est store m1
di ((1.245166-.1655943)/1.245166)*100 // 86.70%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp i.S020 i.S003 [pw=S017] || S025:  , or
est store m2
di ((1.245166-.1615432)/1.245166)*100 // 87.02%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m3

di ((1.245166-.1626202)/1.245166)*100 // 86.94%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m4
di ((1.245166-.1649027)/1.245166)*100 // 86.76%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m5
di ((1.245166-.1361012)/1.245166)*100 // 89.07%

* Table 1: Multilevel logistic regression models predicting support for populist parties
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons 

********************************************************************************
* Supplementary Material *******************************************************
********************************************************************************

********************************************************************************
* Descriptives about Contextual variables **************************************
********************************************************************************

* Including histograms about contextual variables
hist lfirstp, bin(50) name(lfirstp, replace)
hist KOFPoGI, bin(50) name(KOFPoGI, replace)
hist KOFEcGI, bin(50) name(KOFEcGI, replace) 
hist b_checks, bin(50) name(b_checks, replace)

* Figure A1: Density distributions of Executive-parties dimension index, KOF Political Globalization Index, KOF Economic Globalization Index, and Checks on Government Index.
graph combine lfirstp KOFPoGI KOFEcGI b_checks, col(2) scheme(s1mono) commonscheme iscale(.5) xsize(100) ysize(50)

* Including descriptives grouping contextual variables in each country 
graph hbar lfirstp, over(S025, sort(1) descending) name(lfirstp, replace)
graph hbar KOFPoGI, over(S025, sort(1) descending) name(KOFPoGI, replace)
graph hbar KOFEcGI, over(S025, sort(1) descending) name(KOFEcGI, replace) 
graph hbar b_checks, over(S025, sort(1) descending) name(b_checks, replace)

* Figure A2: Executive-parties dimension index and Checks on Government Index by country-years
graph combine lfirstp b_checks, col(2) scheme(s1mono) commonscheme iscale(.5) xsize(100) ysize(50)
* Figure A3: KOF Political Globalization Index and KOF Economic Globalization Index by country-years
graph combine KOFPoGI KOFEcGI, col(2) scheme(s1mono) commonscheme iscale(.5) xsize(100) ysize(50)

********************************************************************************
* Pre-2008 vs Post-2008 (Table A5)**********************************************
********************************************************************************
gen crisis=.
replace crisis=0 if S020<=2008
replace crisis=1 if S020>2008
* Pre-crisis
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] if crisis==0 || S025: , or
estat icc
est store m0
* ICC: 29,68%

melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc  [pw=S017]if crisis==0 || S025:  , or
estat icc
est store m1
di ((1.388973-1.255259)/1.388973)*100 // 9.62%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp [pw=S017] if crisis==0 || S025:  , or
estat icc
est store m2
di ((1.388973-1.238723)/1.388973)*100 // 10.82% // (Table A5)

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc [pw=S017] if crisis==0 || S025:  , or
estat icc
est store m3
di ((1.388973-1.241863)/1.388973)*100 // 10.59%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc [pw=S017] if crisis==0 || S025:  , or
estat icc
est store m4
di ((1.388973- 1.23084)/1.388973)*100 // 11.38%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc [pw=S017] if crisis==0 || S025:  , or
estat icc
est store m5
di ((1.388973- 1.237429)/1.388973)*100 // 10.91%

* Table A5: Multilevel logistic regression models predicting support for populist parties for country-years before 2008 (N=29,180; Country-years=27) and after 2008 (N=43,472; Country-years=32). Control variables are omitted from the table. The table including all estimates is available under request
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A5)

* Post-crisis
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] if crisis==1 || S025: , or
estat icc
est store m0
* ICC: 27,45%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc  [pw=S017] if crisis==1 || S025: , or
estat icc
est store m1
di ((1.049143-.8781098)/1.049143)*100 // 16.30%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp  [pw=S017] if crisis==1 || S025:  , or
estat icc
est store m2
di ((1.049143-.8747685)/1.049143)*100 // 16.62%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc [pw=S017] if crisis==1 || S025:  , or
estat icc
est store m3
di ((1.049143-.8419834)/1.049143)*100 // 19.74%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc [pw=S017] if crisis==1 || S025:  , or
estat icc
est store m4
di ((1.049143-.8691181)/1.049143)*100 // 17.16%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc [pw=S017] if crisis==1 || S025:  , or
estat icc
est store m5
di ((1.049143-.8100153)/1.049143)*100 // 22.79%

* Table A5: Multilevel logistic regression models predicting support for populist parties for country-years before 2008 (N=29,180; Country-years=27) and after 2008 (N=43,472; Country-years=32). Control variables are omitted from the table. The table including all estimates is available under request
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A5)

********************************************************************************
* West vs East (Table A6)*******************************************************
********************************************************************************
gen west=.
replace west=1 if inlist(S003, 40, 56, 208, 246, 250, 276, 300, 372, 380, 442, 528, 578, 724, 752, 756, 826)
replace west=0 if west==.
tab S003 west

* Western Democracies
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] if west==1 || S025: , or
estat icc
est store m0
* ICC: 17,87%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc  [pw=S017] if west==1 || S025: , or
estat icc
est store m1
di ((.716266-.5899587)/.716266)*100 // 17.63%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp  [pw=S017] if west==1 || S025:  , or
estat icc
est store m2
di ((.716266-.5558468)/.716266)*100 // 22.40%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc  [pw=S017] if west==1 || S025:  , or
estat icc
est store m3
di ((.716266-.5840075)/.716266)*100 // 18.46%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc  [pw=S017] if west==1 || S025:  , or
estat icc
est store m4
di ((.716266-.5513631)/.716266)*100 // 23.02%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc [pw=S017] if west==1 || S025:  , or
estat icc
est store m5
di ((.716266-.5867289)/.716266)*100 // 18.08%

* Table A6: Multilevel logistic regression models predicting support for populist parties in Western Europe (N=44,877; Country-years=33) and Eastern Europe (N=27,775; Country-years=26). Control variables are omitted from the table. The table including all estimates is available under request.
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A6)

* Eastern Democracies
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] if west==0 || S025: , or
estat icc
est store m0
* ICC: 35,44%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc  [pw=S017] if west==0  || S025: , or
estat icc
est store m1
di ((1.806043-1.32918)/1.806043)*100 // 26.40%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp  [pw=S017] if west==0  || S025:  , or
estat icc
est store m2
di ((1.806043-.9239138)/1.806043)*100 // 48.84%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc  [pw=S017] if west==0  || S025:  , or
estat icc
est store m3
di ((1.806043-1.325407)/1.806043)*100 // 26.61%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc  [pw=S017] if west==0  || S025:  , or
estat icc
est store m4
di ((1.806043-1.26599)/1.806043)*100 // 29.90%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc [pw=S017] if west==0  || S025:  , or
estat icc
est store m5
di ((1.806043-1.22878)/1.806043)*100 // 31.96%

* Table A6: Multilevel logistic regression models predicting support for populist parties in Western Europe (N=44,877; Country-years=33) and Eastern Europe (N=27,775; Country-years=26). Control variables are omitted from the table. The table including all estimates is available under request.
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A6)

********************************************************************************
* Right-wing Populist Parties (Table A7)****************************************
********************************************************************************
* Restricting to context with right-wing populist parties
replace rwp=0 if rwp==.
tab rwp, m
replace rwp=. if inlist(S025, 2032008, 3722008, 4402008, 4402018, 4422008, 7242017)

* Fitting the Intercept-only model 
*Null model 
melogit rwp [pw=S017] || S025: , or
estat icc
est store m0
* ICC: 25,55%

* Individual and contextual fixed effects model 
melogit rwp  education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc i.S020 i.S003  [pw=S017] || S025:  , or
estat icc
est store m1
di ((1.129128-.0982733)/1.129128)*100 // 91.29%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit rwp education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp i.S020 i.S003  [pw=S017] || S025:  , or
estat icc
est store m2
di ((1.129128-.0919314)/1.129128)*100 // 91.85%

* + Political globalisation (H.3a) 
melogit rwp education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
estat icc
est store m3
di ((1.129128-.0534854)/1.129128)*100 // 95.26%

* + Economic globalisation (H.3b) 
melogit rwp education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
estat icc
est store m4
di ((1.129128-.0933034)/1.129128)*100 // 91.73%

* + Checks on government (H.4) 
melogit rwp education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc i.S020 i.S003 [pw=S017] || S025:  , or
estat icc
est store m5
di ((1.129128-.097562)/1.129128)*100 // 91.36%

*Table A7: Multilevel logistic regression models predicting support for right-wing populist parties (N=66,494; Country-years=53). Control variables are omitted from the table. The table including all estimates is available under request
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A7)


replace lwp=0 if lwp==.
tab lwp, m
tab S025 lwp 
* Analyses would not be comparable due to the low number of clusters (10)


********************************************************************************
* Without populists in power (Table A8)*****************************************
********************************************************************************
*Null model 
melogit populist [pw=S017] if pop_gov==0 || S025: , or
estat icc
est store m0
* ICC: 29,11%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc [pw=S017] if pop_gov==0  || S025: , or
estat icc
est store m1
di ((1.351535-1.113099)/1.351535)*100 // 17.64%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp  [pw=S017] if pop_gov==0  || S025:  , or
estat icc
est store m2
di ((1.351535-1.111798)/1.351535)*100 // 17.74%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc [pw=S017] if pop_gov==0  || S025:  , or
estat icc
est store m3
di ((1.351535-1.083321)/1.351535)*100 // 19.84%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc [pw=S017] if pop_gov==0  || S025:  , or
estat icc
est store m4
di ((1.351535-1.110997)/1.351535)*100 // 17.80%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc [pw=S017] if pop_gov==0  || S025:  , or
estat icc
est store m5
di ((1.351535-1.105392)/1.351535)*100 // 18.21%

*Table A8: Multilevel logistic regression models predicting support for populist parties excluding contexts with populists in power (N=49,698; Country-years=39). Control variables are omitted from the table. The table including all estimates is available under request.
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A8)

********************************************************************************
* Distinguishing Country and Country-years effets (Table A9)********************
********************************************************************************
* Creating country-means of the contextual variables
bysort S003: egen lfirstp_mean=mean(lfirstp)
bysort S003: egen KOFPoGI_mean=mean(KOFPoGI)
bysort S003: egen KOFEcGI_mean=mean(KOFEcGI)
bysort S003: egen b_checks_mean=mean(b_checks)
fre lfirstp_mean KOFPoGI_mean KOFEcGI_mean b_checks_mean

* Deriving the differences from group means of country-years
gen lfirstp_diff=lfirstp-lfirstp_mean
gen KOFPoGI_diff=KOFPoGI-KOFPoGI_mean
gen KOFEcGI_diff=KOFEcGI-KOFEcGI_mean
gen b_checks_diff=b_checks-b_checks_mean
fre lfirstp_diff KOFPoGI_diff KOFEcGI_diff b_checks_diff 

* Creating country-means of the contextual variables (Controls)
bysort S003: egen realgdpgr_mean=mean(realgdpgr)
bysort S003: egen unemp_mean=mean(unemp)
bysort S003: egen ind_perc_mean=mean(ind_perc)
bysort S003: egen sstran_mean=mean(sstran)
fre realgdpgr_mean unemp_mean ind_perc_mean sstran_mean

* Deriving the differences from group means of country-years (Controls)
gen realgdpgr_diff=realgdpgr-realgdpgr_mean
gen unemp_diff=unemp-unemp_mean
gen ind_perc_diff=ind_perc-ind_perc_mean
gen sstran_diff=sstran-sstran_mean
fre realgdpgr_diff unemp_diff ind_perc_diff sstran_diff

* Replicating initial bivariate analyses
* + Pluralism (lfirstp) (H.1)
melogit populist lfirstp_mean lfirstp_diff  [pw=S017] || S003: || S025: , or
margins, at(lfirstp_diff=(-1.04 -0.14 0  0.08  0.89)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(lijphart, replace)

* + Political globalisation (H.2a) 
melogit populist KOFPoGI_mean KOFPoGI_diff [pw=S017] || S003: || S025: , or
margins, at(KOFPoGI_diff=(-1.77 -0.52 0  0.46  3.53)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(pol_glob, replace)

* + Economic globalisation (H.2b) 
melogit populist KOFEcGI_mean KOFEcGI_diff [pw=S017] || S003: || S025: , or
margins, at(KOFEcGI_diff=(-7.44 -1.39 0  0.86  10.43)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(eco_glob, replace)

* + Checks on government (H.4) 
melogit populist b_checks_mean b_checks_diff [pw=S017] || S003: || S025: , or
margins, at(b_checks_diff=(-7.28 -1.33 -0.02  0.23  13.68)) atmeans post
marginsplot, recast(line) recastci(rarea) scheme(s1mono) name(checks, replace)

graph combine lijphart pol_glob eco_glob checks, col(2) ycommon scheme(s1mono) commonscheme iscale(.5)

* Replicating main test analyses including a three-level structure 
* Dependent variable : Populist Parties
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] || S003: || S025: , or
estat icc
est store m0
* ICC: 27,45%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_diff unemp_diff ind_perc_diff sstran_diff realgdpgr_mean unemp_mean ind_perc_mean sstran_mean  [pw=S017] || S003: || S025: , or
estat icc
est store m1
di ((.4680249-.4148629)/.4680249)*100 // 11.35%
di ((.7299058-.5513026)/.7299058)*100 // 24.47%

* Testing the additive effects hypotheses
* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader realgdpgr_diff unemp_diff ind_perc_diff sstran_diff lfirstp_diff realgdpgr_mean unemp_mean ind_perc_mean sstran_mean lfirstp_mean [pw=S017] || S003: || S025: , or
est store m2
di ((.4680249-.4188915)/.4680249)*100 // 10.49%
di ((.7299058-.5448858)/.7299058)*100 // 25.35%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_diff unemp_diff ind_perc_diff sstran_diff KOFPoGI_diff realgdpgr_mean unemp_mean ind_perc_mean sstran_mean KOFPoGI_mean [pw=S017] || S003: || S025: , or
est store m3
di ((.4680249-.3739564)/.4680249)*100 // 20.09%
di ((.7299058-.5484422)/.7299058)*100 // 24.86%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_diff unemp_diff ind_perc_diff sstran_diff KOFEcGI_diff realgdpgr_mean unemp_mean ind_perc_mean sstran_mean KOFEcGI_mean [pw=S017] || S003: || S025: , or
est store m4
di ((.4680249-.4064789)/.4680249)*100 // 13.15%
di ((.7299058-.5347897)/.7299058)*100 // 26.73%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader realgdpgr_diff unemp_diff ind_perc_diff sstran_diff b_checks_diff realgdpgr_mean unemp_mean ind_perc_mean sstran_mean b_checks_mean [pw=S017] || S003: || S025: , or
est store m5
di ((.4680249-.4261237)/.4680249)*100 // 8.95%
di ((.7299058-.4469519)/.7299058)*100 // 38.76%

*Table A9: Multilevel logistic regression models predicting support for populist parties decomposing within- and between-country effects
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A9) 

********************************************************************************
* Including Anti-immigrant attitudes (Table A11)********************************
********************************************************************************
* Including Anti-immigrant attitudes in the main analyses
* Since no variable of Anti-immigrant attitudes is consistently collected across the EVS/WVS surveys we considered, we use a variable measuring nationalism (How proud of Nationality)
* Sample is different as missings of variable are different
reg populist distrust i.soc_trust strong_leader G006 education i.gender age i.unemployed lfirstp
gen nationalism=1 if e(sample)  

* Dependent variable : Populist Parties
* Fitting the Intercept-only model 
*Null model 
melogit populist [pw=S017] if nationalism==1  || S025: , or 
estat icc
est store m0
* ICC: 27,45%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader G006 realgdpgr_mc unemp_mc ind_perc_mc sstran_mc i.S020 i.S003  [pw=S017] || S025:  , or
estat icc
est store m1
di ((1.208332-.1701558)/1.208332)*100 // 85.91%

* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust i.soc_trust strong_leader G006 realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp i.S020 i.S003  [pw=S017] || S025:  , or
est store m2
di ((1.208332-.165306)/1.208332)*100 // 86.32%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader G006 realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m3
di ((1.208332-.1663769)/1.208332)*100 // 86.23%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader G006 realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m4
di ((1.208332-.1696335)/1.208332)*100 // 85.96%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust i.soc_trust strong_leader G006 realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m5
di ((1.208332-.1380155)/1.208332)*100 // 88.57%

*Table A11: Multilevel logistic regression models predicting support for populist parties. Including Nationalist attitudes.
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A11) 

********************************************************************************
* Including Eurosceptical attitudes (Table A12)*********************************
********************************************************************************
* We use Distrust in European Union as variable to measure Eurosceptical attitudes
* Sample is different as missings of variable are different
reg populist distrust i.soc_trust strong_leader E069_18 education i.gender age i.unemployed lfirstp
gen euroscepticism=1 if e(sample)  

*Null model 
melogit populist [pw=S017] if euroscepticism==1 || S025: , or
estat icc
est store m0
* ICC: 27,45%

* Individual and contextual fixed effects model 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust E069_18 i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc i.S020 i.S003  [pw=S017] || S025:  , or
estat icc
est store m1
di ((1.251421-.1595445)/1.251421)*100 // 87.25%

* + Pluralism (lfirstp) (H.1)
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed distrust E069_18  i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc lfirstp i.S020 i.S003  [pw=S017] || S025:  , or
est store m2
di ((1.251421-.1561261)/1.251421)*100 // 87.52%

* + Political globalisation (H.3a) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust E069_18 i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc pol_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m3
di ((1.251421-.1557669)/1.251421)*100 // 87.55%

* + Economic globalisation (H.3b) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust E069_18 i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc eco_glob_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m4
di ((1.251421-.1579364)/1.251421)*100 // 87.38%

* + Checks on government (H.4) 
melogit populist education_mc i.gender age_mc age_mc2 i.unemployed  distrust E069_18 i.soc_trust strong_leader realgdpgr_mc unemp_mc ind_perc_mc sstran_mc b_checks_mc i.S020 i.S003 [pw=S017] || S025:  , or
est store m5
di ((1.251421-.1310298)/1.251421)*100 // 89.53%

*Table A12: Multilevel logistic regression models predicting support for populist parties. Including Distrust towards European Union Parliament
esttab m0 m1 m2 m3 m4 m5, b(%9,3f) se(%9,3f) aic bic label eform cons // (Table A12) 


log close 